
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn = 10010;
#define keyTree (ch[ch[root][1]][0])
int sum=0;
template<class T>
struct SplayTree
{
	int size[maxn],ch[maxn][2],P[maxn],stack[maxn],queue[maxn];
	int flag[maxn],num[maxn];
	int C, Top, root;
	T key[maxn];
	int count;
	void makeTree(int &x, int l, int r, int p, T value[])
	{
		if (l > r)
			return;
		int m = (l + r) >> 1;
		newNode(x, value[m]);
		makeTree(ch[x][0], l, m - 1, x, value);
		makeTree(ch[x][1], m + 1, r, x, value);
		P[x] = p;
		push_up(x);
	}
	void init(int l, int r, T value[])
	{
		C = root = 0;
		count = 0;
		Top = 0;
		newNode(root, value[0]);
		newNode(ch[root][1], value[0]);
		P[C] = root;
		makeTree(keyTree, l, r, ch[root][1], value);
		push_up(ch[root][1]);
		push_up(root);
	}
	void rotate(int x, int f)
	{
		int y = P[x];
		push_down(y);
		push_down(x);
		ch[y][!f] = ch[x][f];
		P[ch[x][f]] = y;
		P[x] = P[y];
		if (P[x])
			ch[P[y]][ch[P[y]][1] == y] = x;
		ch[x][f] = y;
		P[y] = x;
		push_up(y);
	}
	void splay(int x, int goal)
	{
		if (!x)
			return;
		push_down(x);
		while (P[x] != goal)
		{
			if (P[P[x]] == goal)
				rotate(x, ch[P[x]][0] == x);
			else
			{
				int y = P[x], z = P[y];
				int f = (ch[z][0] == y);
				if (ch[y][f] == x)
					rotate(x, !f), rotate(x, f);
				else
					rotate(y, f), rotate(x, f);
			}
		}
		push_up(x);
		if (goal == 0)
			root = x;
	}
	int select(int x, int i)
	{
		if (!x)
			return 0;
		push_down(x);
		int r = size[ch[x][0]] + 1;
		if (i == r)
			return x;
		else if (i < r)
			return select(ch[x][0], i);
		else
			return select(ch[x][1], i - r);
	}
	void rotateTo(int k, int goal)
	{
		int x = select(root, k);
		if (x)
			splay(x, goal);
	}
	void delTree(int x)
	{
		int head = 0, tail = 0;
		for (queue[tail++] = x; head < tail; head++)
		{
			stack[Top++] = queue[head];
			count--;
			if (ch[queue[head]][0])
				queue[tail++] = ch[queue[head]][0];
			if (ch[queue[head]][1])
				queue[tail++] = ch[queue[head]][1];
		}
	}
	void newNode(int &x, const T& c)
	{
		if (Top)
			x = stack[--Top];
		else
			 x= ++C;
		ch[x][0] = ch[x][1] = P[x] = 0;
		size[x] = 1;
		key[x] = c;
		num[x]=1;
		count++;
	}
	void push_up(int x)
	{
		size[x] = size[ch[x][0]] + size[ch[x][1]] + 1;
	}
	void push_down(int x)
	{
		if (flag[x])
		{
		}
	}
	void insert(const T& k)
	{
		int z;
		newNode(z, k);
		int x = root, y = 0;
		while (x)
		{
			y = x;
			if (k < key[x])
				x = ch[x][0];
			else
				x = ch[x][1];
		}
		P[z] = y;
		if (!y)
			root = z;
		else if (k < key[y])
			ch[y][0] = z;
		else
			ch[y][1] = z;
		splay(z, 0);
	}
	void del(int z)
	{
		int x, y, dest;
		if (!ch[z][0] || !ch[z][1])
		{
			y = z;
		}
		else
		{
			y = next(z);
		}
		if (ch[y][0])
			x = ch[y][0];
		else
			x = ch[y][1];
		if (x)
			P[x] = P[y];
		if (!P[y])
			root = x;
		else if (y == ch[P[y]][0])
			ch[P[y]][0] = x;
		else
			ch[P[y]][1] = x;
		if (y != z)
			key[z] = key[y];
		splay(P[y], 0);
		stack[Top++] = y;
		count--;
	}
	int min(int x)
	{
		while (ch[x][0])
			x = ch[x][0];
		return x;
	}
	int max(int x)
	{
		while (ch[x][1])
			x = ch[x][1];
		return x;
	}
	int next(int x)
	{
		if (ch[x][1])
			return min(ch[x][1]);
		int y = P[x];
		while (y && x == ch[y][1])
		{
			x = y;
			y = P[y];
		}
		return y;
	}
	int pre(int x)
	{
		if (ch[x][0])
			return max(ch[x][0]);
		int y = P[x];
		while (y && x == ch[y][0])
		{
			x = y;
			y = P[y];
		}
		return y;
	}
	int search(T& k)
	{
		int x = root;
		while (x && !(k == key[x]))
		{
			if (k < key[x])
				x = ch[x][0];
			else
				x = ch[x][1];
		}
		if (x)
			splay(x, 0);
		return x;
	}
	T& operator[](int i)
	{
		return key[i];
	}
	/*T query(int x,int y)
	  {
	  rotateTo(x-1,0);
	  rotateTo(y+1,root);
	  return key[keyTree];
	  }*/
};
int main()
{
	string str;
	SplayTree<string>stree;
	while(getline(cin,str))
	{
		sum++;
		int x=stree.search(str);
		if(x!=0)stree.num[x]++;
		else stree.insert(str);
	}
	stree.walk();			
	return 0;
}
